import Service from "@/service";

//通过userId查询用户
export function selectUserById(userId: string) {
    return Service.get('/api/user/getUserById?userId=' + userId)
}

//通过参数获取所有用户
export function selectUserData(params: any) {
    return Service.get('/api/user/getData', {params})
}

//保存用户
export function saveUser(params: any) {
    return Service.post('/api/user/save', params)
}

//保存用户基本信息
export function saveUserInfo(params: any) {
    return Service.post('/api/user/saveInfo', params)
}

//保存用户角色
export function saveUserRoles(params: any) {
    return Service.post('/api/user/saveRoles', params)
}

//验证旧密码
export function checkPassword(params: any) {
    return Service.post('/api/user/checkPassword', params)
}

//删除用户
export function delUser(params: any) {
    return Service.post('/api/user/del', params)
}

//获取用户列表给下拉框选择
export function getUsersBySelect() {
    return Service.get('/api/user/getUsersBySelect')
}

//下载用户信息
export function downloadUser(params: any) {
    return Service.request({
        url: '/api/user/download',
        method: 'GET',
        params: params,
        responseType: 'blob'
    })
}
